#include <stdio.h>

#define ASGN 1
#define MUL  2

int asgn(int *a, int b) {
    return *a = b;
}

int mul(int *a, int b) {
    return *a * b;
}

int (*fun(int op)) (int *, int) {
    switch (op) {
    case ASGN:
        return &asgn;       // 返回函数指针
        break;
    case MUL:
        return &mul;
        break;
    default:
        break;
    }
}

int main(int argc, char const *argv[])
{
    int i = 0xFEED, j = 0xBEEF;
    printf("%#x\n", fun(ASGN)(&i, j));  // %#x 显示指出进制
    printf("%#x\n", fun(MUL)(&i, j));
    printf("%#x, %#x\n", i, j);

    return 0;
}
